evaluate right side first, then remember the result as the value on the left side
in case of fractions always round down


1) p.atk = (buffed) attack power


2) if strong regular attack (not applicable to Lv1 tech)
	p.atk = p.atk * (127 + STR) / 117 + 6


3) damage = p.atk - defense


4) if critical hit (not applicable to Lv1 tech)
	4.a) damage = damage * (crit factor + weapon bonus) + crit bonus + (weapon bonus+1)/2
		crit factor:
			0 LUCK: 110%
			10 LUCK: 117%
			15 LUCK: 122%
			20 LUCK: 127%
			25 LUCK: 132%
			28 LUCK: 135%
			30 LUCK: 137%
			33 LUCK: 140%
		crit bonus:
			0 LUCK: 2
			10 LUCK: 15
			15 LUCK: 22
			20 LUCK: 30
			25 LUCK: 40
			28 LUCK: 46
			30 LUCK: 50
			33 LUCK: 56

	4.b) damage = damage * (100% + gear bonus)
		gear bonus:
			crit helm: 25%


5) if Lv1 tech and damage > 1
	damage = damage * (tech factor + weapon bonus + counter bonus + gear counter bonus) + tech bonus
		tech factor:
			0 AGL: 110%
			10 AGL: 130%
			15 AGL: 140%
			20 AGL: 148%
			25 AGL: 156%
			28 AGL: 162%
			30 AGL: 166%
			33 AGL: 170%
		tech bonus:
			0 AGL: 0
			10 AGL: 16
			15 AGL: 22
			20 AGL: 30
			25 AGL: 40
			28 AGL: 46
			30 AGL: 50
			33 AGL: 56
		counter bonus:
			0 if not a counter attack
			otherwise value of weapon
		gear counter bonus:
			0 if not a counter attack
			counter helm: +25%


6) power up/down buff on attacker
	damage = damage * 1.25 for buff
	damage = damage * 0.75 for debuff
	no change if both or neither


7) defense up/down buff on target
	damage = damage * 0.75 for buff
	damage = damage * 1.25 for debuff
	no change if both or neither


8) element of saber matches element of day
	damage x1.25


9) difficulty factor
	varies by character and difficulty, compare to player/enemy strength in the README

10) damage degradation for targetting high level monster
	100% vs players
	100% vs enemies Lv1-10
	47.31% vs enemies Lv99


11) physical resistance/weakness
	x1.00 if equipped with Levatein tier weapon
	x1.50 damage for weakness
	x0.50 damage for resistance
	x0.25 damage for strong resistance
	x0.00 damage for immunity


12) elemental resistance/weakness based on active saber
	x1.50 damage for weakness
	x0.50 damage for resistance
	x0.25 damage for immunity
	add a copy of the damage but as healing for absorption
	add a copy of the damage targetted add the attacker in case of reflection
		if reflected AND the original target had Platinum Armor: x1.75 damage
		otherwise do not change damage


13) damage = damage/2


14) if Ragnarok is equipped and the attack was neither critical nor a Lv1 tech:
	damage = 1


15) cap at 999 damage


16) if Lv1 tech and successful counter attack and Fireblaze equipped:
	reduce target physical defense permanently
		-25% for regular enemies
		-STR/2 for bosses
		-1 for bosses that are "immune" to this effect